#define _CRT_SECURE_NO_WARNINGS	

int isLeapYear(int y)
{
    if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0))
        return 1;
    return 0;
}
int MaxDayMonth(int year, int month)
{
    switch (month)
    {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
        return 31;
    case 4:
    case 6:
    case 9:
    case 11:
        return 30;
    case 2:
        return isLeapYear(year) ? 29 : 28;
    default:
        return 0;
    }
}